package com.cupk.carManageMaster.common.mapper;


import com.cupk.carManageMaster.common.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;


@Repository
@Mapper
public interface UserMapper {
    @Select("select id,number,username,password from user where username = #{userName}")
    User findUserByName(String userName);

    /**
     * 通过用户名、密码获取用户信息
     */
    @Select("select * from job_user where job_number = #{jobNumber} and user_password = #{password}")
    User getUserInfo(@Param("jobNumber") String jobNumber, @Param("password") String password);

    /**
     * 通过用户ID查询用户基本信息
     *
     * @return
     */
    @Select("select * from job_user where id = #{userId}")
    User getUser(Integer userId);
}
